package com.aispeech.imgany.ui;

import android.content.Intent;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.aispeech.imgany.R;
import java.io.File;


public class MainActivity extends AppCompatActivity {

    private final String TAG = "MainActivity";

    @RequiresApi(api = VERSION_CODES.JELLY_BEAN)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        //todo 临时放在这里
        deleteShotImgFile();

        Intent intent = new Intent(MainActivity.this,TestAnimator.class);
        startActivity(intent);

        finish();
    }

    /**
     * 删除截屏文件
     */
    private void deleteShotImgFile() {
        String p = this.getExternalFilesDir("screenshot").getAbsolutePath();
        Log.d(TAG, "deleteShotImgFile path = " + p);
        File fod = new File(p);
        File[] files = fod.listFiles();
        for (File f: files){
            f.delete();
        }
    }
}
